package com.zhang.mqtt.service;

import com.zhang.mqtt.gateway.MqttGateway;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author 超chao
 * @Description 发送消息service
 * @Date 2025/7/24/周四 16:04
 * @Version 1.0
 */
@Component
public class MqttMessageSender {
    @Autowired
    private MqttGateway mqttGateway;

    public void sendMqttMsg(String topic, String payload) {
        mqttGateway.sendMsgToMqtt(topic, payload);
    }

    public void sendMqttMsg(String topic, int qos, String payload) {
        mqttGateway.sendMsgToMqtt(topic, qos, payload);
    }
}
